package com.example.communist_app_api.db.dao;
import com.example.communist_app_api.db.dto.MessageAuditDTO;
import com.example.communist_app_api.db.dto.MessageDTO;
import com.example.communist_app_api.db.pojo.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface MessageDao {

    Integer insert(@Param("content") String content,@Param("photoUrl") String photoUrl,@Param("userId") Integer userId);

    Integer insertBySystem(@Param("content") String content,@Param("userId") Integer userId, @Param("auditor_id") int auditor_id);

    List<MessageDTO> findAllMessage(String content);

    List<Integer> findAllMessageIdByUserId(Integer userId);

    List<MessageDTO> findAllMessageById(@Param("distinctMessageIdList") List<Integer> distinctMessageIdList);

    void deleteMessageById(Integer messageId);

    List<MessageDTO> findAllMessageByWeb(@Param("content") String content, @Param("startTime") Date startTime,@Param("endTime") Date endTime,@Param("organizationIdList") List organizationIdList);

    List<MessageAuditDTO> selectAllMessageByAudit(@Param("organizationId") Integer organizationId, @Param("content") String content);

    Integer updateAuditMessage(@Param("messageId") Integer messageId, @Param("auditorId") Integer auditorId);

    String findContentByMessageId(Integer messageId);

    Message findMessageByMessageId(Integer messageId);
}